import request from '@/utils/request'

// 查询报修请求列表
export function listRequest(query) {
  return request({
    url: '/ycl/request/list',
    method: 'get',
    params: query
  })
}

// 查询报修请求详细
export function getRequest(requestId) {
  return request({
    url: '/ycl/request/' + requestId,
    method: 'get'
  })
}

// 新增报修请求
export function addRequest(data) {
  return request({
    url: '/ycl/request',
    method: 'post',
    data: data
  })
}

// 修改报修请求
export function updateRequest(data) {
  return request({
    url: '/ycl/request',
    method: 'put',
    data: data
  })
}

// 删除报修请求
export function delRequest(requestId) {
  return request({
    url: '/ycl/request/' + requestId,
    method: 'delete'
  })
}

//获取所有用户
export function getAllUsers() {
  return request({
    url: '/ycl/request/getAllUsers',
    method: 'get'
  })
}

//获取所有维修人员
export function getAllpersions() {
  return request({
    url: '/ycl/request/getAllpersions',
    method: 'get'
  })
}

//提交报修请求申请
export  function  submitRepairRequest(requestId){
  return request({
    url: '/ycl/request/submitRepairRequest/' + requestId,
    method: 'get'
  })
}


// 查询未审批报修请求信息列表
export function listRequestNo(query) {
  return request({
    url: '/ycl/request/listNo',
    method: 'get',
    params: query
  })
}

//查询报修请求详细信息批注
export  function  getRequestComment(requestId){
  return request({
    url: '/ycl/request/getRepaireRequestComment/' + requestId,
    method: 'get'
  })
}

// 审批报修请求信息
export function approveRequest(data) {
  return request({
    url: '/ycl/request/editnoapprove',
    method: 'post',
    data: data
  })
}

// 查询已审批报修请求信息列表
export function listFinished(query) {
  return request({
    url: '/ycl/request/listFinished',
    method: 'get',
    params: query
  })
}

//柱状图
export function zhu() {
  return request({
    url: '/ycl/request/zhu',
    method: 'get'
  })
}